"use strict";function StorageVariables(e,t,i){if(this.values=t,this.categoryId=e,this._isInitialized=!1,StorageVariables.definedCategories.indexOf(e)!==-1)throw"Category is not unique ";StorageVariables.definedCategories.push(),StorageVariables._loadValuesInMemory(this.values,this.categoryId,i,this)}StorageVariables._loadValuesInMemory=function(e,t,i,a){function o(t){var o;for(o in t[a.categoryId])t[a.categoryId].hasOwnProperty(o)&&e.hasOwnProperty(o)&&(e[o]=t[a.categoryId][o]);var r=new Event("build");document.dispatchEvent(r),a._isInitialized=!0,i&&i()}chrome.storage.local.get(t,o)},StorageVariables.definedCategories=[],StorageVariables.prototype.setDefaultValues=function(e,t){var i;for(i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(console.log(e[i]),t[i]=e[i])},StorageVariables.prototype.set=function(e,t,i){if(!this._isInitialized)throw"Object did not have time to initialize. Use the callback in the constructor";this.values.hasOwnProperty(e)&&(this.values[e]=t);var a={};a[this.categoryId]=this.values,chrome.storage.local.set(a,i)},StorageVariables.prototype.get=function(e,t){function i(t,i){if(!t.values.hasOwnProperty(e))throw"Trying to access unknown property "+e;i(t.values[e])}if(!this._isInitialized)throw document.addEventListener("build",function(){i(this,t)},!1),"Object did not have time to initialize. Use the callback in the constructor";i(this,t)};